﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using CB.Stock.Core;

namespace CB.Stock.Data.Yahoo
{
    class YahooValueParser<T> : GenericValueParser<T>
    {
        protected override CultureInfo GetSpecialCultureInfo()
        {
            return CultureInfo.GetCultureInfo("en-US");
        }
    }

    /// <summary>
    /// use this to parse int str
    /// </summary>
    class YahooValueParserInt : YahooValueParser<int>
    {
        public override object Parse(string value)
        {
            //int string with comma will not be parsed by default
            //for example 1,234
            value = value.Replace(",", null);
            return base.Parse(value);
        }
    }
}
